
<?php
@session_start();
include "../../../jerimum/classes/bd.php";
include "../../../jerimum/classes/descrever.php";
include "../../../jerimum/classes/anuncios.php";
include "../../../jerimum/classes/clientes.php";
include "../../../jerimum/classes/cartas.php";

$_des		= new descrever(); #CLASSES
$_anu		= new anuncios(); #CLASSES
$_car		= new cartas();
$_cli		= new clientes();

$_des->id	= $_GET["descricao"];
$descricao	= $_des->pega();

$_des->ativo 	= $descricao["ativo"];
$status			= $_des->PegaStatus();

if($_SESSION['idcliente'] != $descricao["idcliente"]){ die("Sem permi&ccedil;&atilde;o para realizar esta a&ccedil;&atilde;o.");}

$anuncio		= $_anu->pega($descricao["idproduto"]);
$data			= converte_datetime($descricao["data"]);
$dados_para_quem_postou = $_cli->pega($descricao["idcliente"]);
$dados_de_quem_postou 	= $_cli->pega($descricao["idclientepost"]);

?>
   <html>
   <head>
   <TITLE>Solmais :: Detalhes da Desscri&ccedil;&atilde;o</TITLE>
   
   <link href="../../../css/estrutura.css" rel="stylesheet" type="text/css" />
   <link href="../../../css/style.css" rel="stylesheet" type="text/css" />
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
   <style type="text/css">
   table{ font-size:12px}
   </style>
   <script type="text/javascript">
	function marcaAcao(acao){
	if(acao=="1"){
	document.getElementById("acao").value = "aceito";
	}
	
	if(acao=="0"){
	document.getElementById("acao").value = "pedente";
	}
	
	//alert(document.getElementById("acao").value);
			
	}
	
	function apagaDescricao(){
		if(confirm("Deseja realmente apagar estes dados?")){
			window.location.href="acao.php?acao=apagar&id=<?PHP print $descricao["id"]; ?>"
			}else{
				return false;
				}
		}

   
   </script>
   
   </head>

   <body> 
<div style="margin-left:10px; width:550px" id="barra-painel">
<p>
   <h1>DESCRI&Ccedil;&Atilde;O DE <?PHP print $dados_de_quem_postou["nome"]; ?></h1>
<div style="width:120px; float:right; background-color:#FAFAFA; border:solid 1px #F0F0F0; padding:5px; margin-top:70px" align="left">

     Marcar isto como:<br />
<form action="acao.php" method="post">
<input type="hidden" name="id" value="<?php print $descricao["id"]; ?>">
<input type="hidden" name="acao" id="acao" value="">
<input type="radio" name="ativo" value="1" <?php if($descricao["ativo"]==1){ echo "checked"; } ?> onClick="javascript:marcaAcao(this.value);" />
Aceito<br />
<input type="radio" name="ativo" value="0" <?php if($descricao["ativo"]==0){ echo "checked"; } ?> onClick="javascript:marcaAcao(this.value);" />
Pedente<br />
<br />
<input name="Submit" type="submit" class="butao_sub" onClick="javascript: if( document.getElementById('acao').value == ''){ return false;};" value="Definir" /> 
<input name="Submit" type="button" class="butao_sub" value="Apagar" style="background-color:#900" onClick="jacascript:apagaDescricao();" />

</form>

   </div>
<p>
<table width="75%" border="0">
                  <tr>
                    <td width="27%" style="background:f0f0f0">Descri&ccedil;&atilde;o n&ordm;</td>
                    <td width="73%" style="background:f0f0f0"><b>
                      <?=$descricao["id"]?>
                    </b></td>
    </tr>
                  <tr>
                    <td style="background:f0f0f0">Esta como</td>
                    <td style="background:f0f0f0"><?PHP print $status; ?></td>
                  </tr>
                  <tr>
                    <td style="background:f0f0f0">Data</td>
                    <td style="background:f0f0f0"><?PHP print $data["data"];  ?> &agrave;s <?PHP print $data["horario"];  ?></td>
                  </tr>
                  

  </table>
                  <br />
  <table width="75%" border=0 cellpadding="5" cellspacing="5" style="border-collapse:collapse; border: solid 1px #F0F0F0">
    
<tr>
  <td width="49%" align="left" valign="top">Item descrevido</td>
  <td width="51%"><strong>
    <?=$anuncio["titulo"]?>
  </strong></td>
</tr>
<tr bgcolor="#f9f9f9">
  <td align="left" valign="top">Fabricante, Marca ou Selo</td>
  <td><?=$descricao['fabricante']?></td>
</tr>
<tr>
  <td align="left" valign="top">Ano de fabrica&ccedil;&atilde;o</td>
  <td><?=$descricao['ano']?></td>
</tr>
<tr bgcolor="#f9f9f9">
  <td align="left" valign="top">Cor</td>
  <td><?=htmlentities($descricao['cor'])?></td>
</tr>
<tr>
  <td align="left" valign="top">Peso ou Medida</td>
  <td><?=$descricao['peso']?></td>
</tr>
<tr bgcolor="#f9f9f9">
  <td align="left" valign="top">Garantia</td>
  <td><?=$descricao['garantia']?></td>
</tr>
<tr>
  <td align="left" valign="top">S&eacute;rie, Modelo ou Especifica&ccedil;&otilde;es</td>
  <td><?=htmlentities($descricao['serie'])?></td>
</tr>

            
            
        </table>
            
            
            
            
            
 </div>   
            
   </body></html>
         
            